package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.Clazz;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@Mapper
public interface ClazzMapper {
    Page<Clazz> page(String name, LocalDate begin, LocalDate end);

    @Delete("delete from clazz where id = #{id}")
    Boolean deleteById(Integer id);

    void insert(Clazz clazz);

    Clazz getById(Integer id);

    void updateById(Clazz clazz);

    List<Clazz> list();

    @MapKey("clazz")
    List<Map<String, Object>> countStudentData();
}